﻿@model ArchiveViewModel
@{
    var archive = Model.Archive;
}
@{
    ViewBag.Title = archive.Title;
    Layout = "~/Areas/HomePage/Views/Shared/_DefaultLayout.cshtml";
}
@section CssLink{
    <link href="@Url.Content("~/css/Common/jquery.ScrollImage.css")" rel="stylesheet" type="text/css" />
}
@section ScriptLink{
    <script src="@Url.Content("~/Scripts/common/jquery.ScrollImage.js?" + DateTime.Now)" type="text/javascript"></script>
}
@section ScriptContent{
    <script type="text/javascript">
        $(function () {
            $("#divAlbum").ScrollImage({ // 图片
                image: { space: 106, shownum: 6 },
                onimageclick: function () {
                    var s = $(this);
                    $("div.cover img").fadeOut("normal", function () {
                        $("div.cover img").attr("src", s.attr("src"));
                        //$("div.cover a").attr("href", s.attr("data-path")).attr("target", "_blank");
                    }).fadeIn("normal");
                }
            });
        });
    </script>
}
@section CssContent
{
    <style type="text/css">
        .right
        {
            padding-right: 20px;
        }
        .right .articleBody
        {
            line-height: 1.5;
            padding: 5px 0;
        }
        .right .author
        {
            background-color: #f2f2f2;
            padding: 5px 0;
        }
        .right .author span
        {
            color: #ccc;
        }
        .divAlbum
        {
            border: solid 1px #cccccc;
        }
        .divAlbum .cover
        {
            height: 450px;
            padding: 5px;
            margin-bottom: 10px;
            text-align: center;
        }
        #divAlbum
        {
            border-top: solid 1px #cccccc;
            padding: 5px 0;
        }
        #divAlbum img
        {
            width: 100px;
            padding: 1px;
            margin: 2px;
        }
    </style>
}
<div class="left">
    <div class="headr">
    </div>
    <div>
        @{Html.RenderAction("RelatePart", new { eTag = Model.Archive.Classify.ETag, pageSize = 10 });}
    </div>
</div>
<div class="right">
    <h3 class="textCenter">
        @archive.Title
    </h3>
    <div class="author">
        【<span>作者：</span>@{ Write(archive.Author ?? "Admin");}
        <span>】 | 【加入时间：</span>@archive.AddDateTime】 | 【<span>点击数：</span>@archive.ClickCount】
        | 【<span>来源:</span>@{Write(archive.Source ?? "管理工程系");}
        】
    </div>
    <div class="articleBody">
        @{
            if (archive.Album.Count > 0)
            {
            <div class="divAlbum">
                <div class="cover">
                    <img src="" alt="" />
                </div>
                <div id="divAlbum" class="showNone">
                    @{
                foreach (var item in archive.Album)
                {
                        <img src="@Url.Action("Thumb", new { w = 450, h = 450, s = string.Format("{0}/{1}/{2}", Model.ImageRoot, archive.NewsId, item.ImageName) })"
                         alt="@item.Title" />
                }
                    }
                </div>
            </div>
            }
        }
        <div>
            @{WriteLiteral(archive.Contents);}
        </div>
    </div>
</div>
